package com.cate.result;

import lombok.Data;

import java.io.Serializable;

/**
 * @CreateTime: 2023/6/27
 * @Author: <==lhd==>
 * @Description: 统一封装响应体
 */
@Data
public class RestResponse<T> implements Serializable {

    private int code;

    private T data;

    private String msg;

    public RestResponse(int code, T data, String message) {

        this.code = code;
        this.data = data;
        this.msg = message;
    }

    public RestResponse(int code, String message){
        this.code = code;
        this.data = null;
        this.msg = message;
    }

    public RestResponse(SystemCode code){
        this(code.getCode(),null,code.getMessage());
    }

}
